﻿
/* 
 * Since 2008 - 2012
 */
package com.hh.bss.talent.entity;

import javax.validation.constraints.NotNull;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.hh.bss.base.BaseEntity;
import com.hh.bss.util.DateConvertUtils;



public class CvContactDetail extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	//alias
	public static final String TABLE_ALIAS = "CvContactDetail";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_CV_ID = "cvId";
	public static final String ALIAS_CONTACT_TYPE = "contactType";
	public static final String ALIAS_NBR = "nbr";
	public static final String ALIAS_NBR_EXT1 = "nbrExt1";
	public static final String ALIAS_NBR_EXT2 = "nbrExt2";
	public static final String ALIAS_COMMENT = "comment";
	public static final String ALIAS_CREATOR = "creator";
	public static final String ALIAS_CREATE_DT = "createDt";
	public static final String ALIAS_MODIFIER = "modifier";
	public static final String ALIAS_MODIFIED_DT = "modifiedDt";
	
	//date formats
	public static final String FORMAT_CREATE_DT = DATE_FORMAT;
	public static final String FORMAT_MODIFIED_DT = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	@NotNull 
	private java.lang.Integer cvId;
	@NotBlank @Length(max=20)
	private java.lang.String contactType;
	@NotBlank @Length(max=100)
	private java.lang.String nbr;
	@Length(max=100)
	private java.lang.String nbrExt1;
	@Length(max=100)
	private java.lang.String nbrExt2;
	@Length(max=200)
	private java.lang.String comment;
	@Length(max=50)
	private java.lang.String creator;
	
	private java.util.Date createDt;
	@Length(max=50)
	private java.lang.String modifier;
	
	private java.util.Date modifiedDt;
	/**是否被删除*/
	private Integer isDelete = 0;
	
	
	//columns END

	public Integer getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(Integer isDelete) {
		this.isDelete = isDelete;
	}

	public CvContactDetail(){
	}

	public CvContactDetail(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setCvId(java.lang.Integer value) {
		this.cvId = value;
	}
	
	public java.lang.Integer getCvId() {
		return this.cvId;
	}
	public void setContactType(java.lang.String value) {
		this.contactType = value;
	}
	
	public java.lang.String getContactType() {
		return this.contactType;
	}
	public void setNbr(java.lang.String value) {
		this.nbr = value;
	}
	
	public java.lang.String getNbr() {
		return this.nbr;
	}
	public void setNbrExt1(java.lang.String value) {
		this.nbrExt1 = value;
	}
	
	public java.lang.String getNbrExt1() {
		return this.nbrExt1;
	}
	public void setNbrExt2(java.lang.String value) {
		this.nbrExt2 = value;
	}
	
	public java.lang.String getNbrExt2() {
		return this.nbrExt2;
	}
	public void setComment(java.lang.String value) {
		this.comment = value;
	}
	
	public java.lang.String getComment() {
		return this.comment;
	}
	public void setCreator(java.lang.String value) {
		this.creator = value;
	}
	
	public java.lang.String getCreator() {
		return this.creator;
	}
	public String getCreateDtString() {
		return DateConvertUtils.format(getCreateDt(), FORMAT_CREATE_DT);
	}
	public void setCreateDtString(String value) {
		setCreateDt(DateConvertUtils.parse(value, FORMAT_CREATE_DT,java.util.Date.class));
	}
	
	public void setCreateDt(java.util.Date value) {
		this.createDt = value;
	}
	
	public java.util.Date getCreateDt() {
		return this.createDt;
	}
	public void setModifier(java.lang.String value) {
		this.modifier = value;
	}
	
	public java.lang.String getModifier() {
		return this.modifier;
	}
	public String getModifiedDtString() {
		return DateConvertUtils.format(getModifiedDt(), FORMAT_MODIFIED_DT);
	}
	public void setModifiedDtString(String value) {
		setModifiedDt(DateConvertUtils.parse(value, FORMAT_MODIFIED_DT,java.util.Date.class));
	}
	
	public void setModifiedDt(java.util.Date value) {
		this.modifiedDt = value;
	}
	
	public java.util.Date getModifiedDt() {
		return this.modifiedDt;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("CvId",getCvId())
			.append("ContactType",getContactType())
			.append("Nbr",getNbr())
			.append("NbrExt1",getNbrExt1())
			.append("NbrExt2",getNbrExt2())
			.append("Comment",getComment())
			.append("Creator",getCreator())
			.append("CreateDt",getCreateDt())
			.append("Modifier",getModifier())
			.append("ModifiedDt",getModifiedDt())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof CvContactDetail == false) return false;
		if(this == obj) return true;
		CvContactDetail other = (CvContactDetail)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

